There are 2 ways to stimulate the penis. Through the brain, and
through localise stimulation.
Stimulation through the brain means through thoughts,
visualisations, and sound.
Local stimulation means touching of the penis itself. By touching
the penis, local reflexive reactions will cause the penis to
erect.
So that's why, without any sexual stimulation to the brain, the
penis can also go erect on its own if the penis is touched.
So, a male can be raped without having the urge to have sex.
Because as long as someone stimulate the penis itself, it will go
erect.